/*
 * Name: $RCSfile: Utils.java,v $
 * Version: $Revision: 1.1 $
 * Date: $Date: Dec 15, 2011 1:56:00 PM $
 *
 * Copyright (C) 2011 DirecTV, Inc. All rights reserved.
 */

package com.admissions.utils;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import android.util.Log;

/**
 * This class to optimal for stream.
 * 
 * @author DirecTV
 * 
 */
public class Utils
{
    public static final int BUFFER_SIZE = 1024;

    public static void copyStream(InputStream is, OutputStream os)
    {
        try
        {
            byte[] bytes = new byte[BUFFER_SIZE];
            for (;;)
            {
                int count = is.read(bytes, 0, BUFFER_SIZE);
                if (count == -1)
                    break;
                os.write(bytes, 0, count);
            }
        }
        catch (IOException ex)
        {
            Log.d(Utils.class.getName(), "IOException");
        }
    }
}